// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: Zero "\0" not terminates the string(C string)
es5id: 8.4_A5
description: Insert "\0" into string
---*/

// CHECK#1
function Test() {
    if ("x\0y" === "x") {
      throw new Test262Error('#1: "x\\0y" !== "x"');
    }

// CHECK#2
    if (!(("x\0a" < "x\0b") && ("x\0b" < "x\0c"))) {
      throw new Test262Error('#2: (("x\\0a" < "x\\0b") && ("x\\0b" < "x\\0c")) === true');
    }
}

// preheat
const NUMBER_OF_PREHEAT = 1;
for (let i = 0; i < NUMBER_OF_PREHEAT; i++) {
    Test();
}

ArkTools.jitCompileAsync(Test);
assert.sameValue(ArkTools.waitJitCompileFinish(Test), true, '[JIT] JIT disabled.');

// test
const NUMBER_OF_TEST = 1; // or 2
for (let i = 0; i < NUMBER_OF_PREHEAT; i++) {
    Test();
}
